/**
 *
 */
package edu.nps.ai.agent;

/**
 * A runnable method to ensure the agent is cleaned up properly
 * @author Timothy Riley
 *
 */
public class AgentShutdown implements Runnable {
	/**
	 * Holds the agent to shutdown
	 */
	private Agent agent;

	/**
	 * @param agent The agent to shutdown
	 */
	public AgentShutdown(final Agent agent) {
		if (agent == null) {
			throw new IllegalArgumentException("The agent is required");
		}
		this.agent = agent;
	}

	/**
	 * Execute the agent destroy
	 * @see java.lang.Runnable#run()
	 */
	public void run() {
		agent.destroy();
	}

}
